package com.hankol.feature_wine_meal.bean

import android.text.TextUtils
import com.baselibrary.BuildConfig
import com.baselibrary.Constants
import com.baselibrary.bean.SelectSendFriend4Bean
import com.baselibrary.router.ActivityRouter.WINE_MEAL.WINE_MEAL_DETAILS
import com.baselibrary.utils.SpUtils

fun foodBean2SelectSendFriend2Bean(bean: FoodDetailsBean): SelectSendFriend4Bean {
    return SelectSendFriend4Bean().apply {
        bean.let {
            id = it.id
            showType = Constants.PRIVATE_MES_TYPE_FOOD_DETAILS
            cover = it.cover
            images = arrayListOf(it.cover)
            title = if (TextUtils.isEmpty(it.name)) it.desc else it.name
            content = it.desc
            icon = SpUtils.getInstance().userICon
            name = SpUtils.getInstance().loadUserBean.data.name
            isFans = SpUtils.getInstance().loadUserBean.data.isFans
            route = "thd7pq://foodStalls/foodMenuDetail?menuId=${bean.id}"
        }
    }
}


fun showShare2Bean2SelectSendFriend2Bean(bean: FoodDetailsBean): SelectSendFriend4Bean {
    val path = "$WINE_MEAL_DETAILS?${Constants.WINE_MEAL_DETAILS_ID}=${bean.id}"
    return SelectSendFriend4Bean().apply {
        bean.let {
            id = it.id
            //动态类型  1：图片 2：视频 3话题、4文章、 5直播、6 百科  7 讲坛的视频详情
            showType = Constants.PRIVATE_MES_TYPE_FOOD_DETAILS
            cover = it.cover
            images = listOf(it.cover)
            title = it.name
            content = it.desc
            icon = SpUtils.getInstance().userICon
            name = SpUtils.getInstance().loadUserBean.data.name
            isFans = SpUtils.getInstance().loadUserBean.data.isFans
            route = "${if (BuildConfig.DEBUG) "thd7pq:/" else "r3fuww:/"}${path}"
        }
    }
}


